Skip to content

feat: add systemd service management for Linux#6

Merged
abpai merged 1 commit into
mainfrom
feat/systemd-service
Apr 8, 2026
Merged

feat: add systemd service management for Linux#6
abpai merged 1 commit into
mainfrom
feat/systemd-service

Conversation

@abpai

@abpai abpai commented Apr 8, 2026

Copy link
Copy Markdown
Owner

Summary

  • Adds wildcard systemd install/uninstall/restart commands mirroring the existing launchd equivalents
  • Enables Linux users to install wildcard as a proper systemd user service
  • Respects $XDG_CONFIG_HOME for unit file placement with ~/.config fallback
  • Idempotent install, clean uninstall, path quoting for spaces, 0o644 permissions

New files

  • src/commands/systemd.ts — generator, runner, and three command handlers
  • src/commands/systemd.test.ts — 8 tests covering unit generation and XDG path resolution

Test plan

  • 95 tests pass (8 new systemd-specific)
  • wildcard systemd --help shows install/uninstall/restart
  • wildcard systemd install on macOS prints platform guard message
  • Paths with spaces are quoted in generated unit file
  • Manual: run wildcard systemd install --roots ~/code on a Linux machine

Add `wildcard systemd install/uninstall/restart` commands mirroring the
existing launchd equivalents, enabling Linux users to install wildcard
as a systemd user service.

- Pure `generateSystemdUnit()` function producing unit file with
  Type=exec, Restart=on-failure, file-based logging
- `systemdUnitDir()` respects $XDG_CONFIG_HOME with ~/.config fallback
- Idempotent install: stop+disable before write+reload+enable
- Clean uninstall: stop, disable, remove, daemon-reload, PID cleanup
- Platform guard on all three commands (Linux only)
- Unit file permissions set to 0o644
- Path quoting for spaces in ExecStart
- 8 new tests covering generator output and XDG path resolution
@abpai abpai merged commit 6456fd1 into main Apr 8, 2026
1 check passed
@abpai abpai deleted the feat/systemd-service branch April 8, 2026 19:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant